public class test12 {
    public static void main(String[] args) {
        int[] arr = {1,2,3,4,77};
        int ret = SearchNum(arr,23);
        System.out.println("ret = " + ret);
    }

    //定义方法
    public static int SearchNum(int[] arr,int num){
        int temp = 0;
        for (int i = 0; i < arr.length; i++) {
            if(arr[i] == num){
                temp = arr[i];
            }
        }
        return temp;
    }
}
